This is Info file gcc.info, produced by Makeinfo-1.55 from the input file gcc.texi. This file documents the use and the internals of the GNU compiler. Published by the Free Software Foundation 59 Temple Place - Suite 330 Boston, MA 02111-1307 USA Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled "GNU General Public License," "Funding for Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that the sections entitled "GNU General Public License," "Funding for Free Software," and "Protect Your Freedom--Fight `Look And Feel'", and this permission notice, may be included in translations approved by the Free Software Foundation instead of in the original English. File: gcc.info, Node: Explicit Reg Vars, Next: Alternate Keywords, Prev: Asm Labels, Up: C Extensions Variables in Specified Registers ================================ GNU C allows you to put a few global variables into specified hardware registers. You can also specify the register in which an ordinary register variable should be allocated. * Global register variables reserve registers throughout the program. This may be useful in programs such as programming language interpreters which have a couple of global variables that are accessed very often. * Local register variables in specific registers do not reserve the registers. The compiler's data flow analysis is capable of determining where the specified registers contain live values, and where they are available for other uses. These local variables are sometimes convenient for use with the extended `asm' feature (*note Extended Asm::.), if you want to write one output of the assembler instruction directly into a particular register. (This will work provided the register you specify fits the constraints specified for that operand in the `asm'.) * Menu: * Global Reg Vars:: * Local Reg Vars:: File: gcc.info, Node: Global Reg Vars, Next: Local Reg Vars, Up: Explicit Reg Vars Defining Global Register Variables ---------------------------------- You can define a global register variable in GNU C like this: register int *foo asm ("a5"); Here `a5' is the name of the register which should be used. Choose a register which is normally saved and restored by function calls on your machine, so that library routines will not clobber it. Naturally the register name is cpu-dependent, so you would need to conditionalize your program according to cpu type. The register `a5' would be a good choice on a 68000 for a variable of pointer type. On machines with register windows, be sure to choose a "global" register that is not affected magically by the function call mechanism. In addition, operating systems on one type of cpu may differ in how they name the registers; then you would need additional conditionals. For example, some 68000 operating systems call this register `%a5'. Eventually there may be a way of asking the compiler to choose a register automatically, but first we need to figure out how it should choose and how to enable you to guide the choice. No solution is evident. Defining a global register variable in a certain register reserves that register entirely for this use, at least within the current compilation. The register will not be allocated for any other purpose in the functions in the current compilation. The register will not be saved and restored by these functions. Stores into this register are never deleted even if they would appear to be dead, but references may be deleted or moved or simplified. It is not safe to access the global register variables from signal handlers, or from more than one thread of control, because the system library routines may temporarily use the register for other things (unless you recompile them specially for the task at hand). It is not safe for one function that uses a global register variable to call another such function `foo' by way of a third function `lose' that was compiled without knowledge of this variable (i.e. in a different source file in which the variable wasn't declared). This is because `lose' might save the register and put some other value there. For example, you can't expect a global register variable to be available in the comparison-function that you pass to `qsort', since `qsort' might have put something else in that register. (If you are prepared to recompile `qsort' with the same global register variable, you can solve this problem.) If you want to recompile `qsort' or other source files which do not actually use your global register variable, so that they will not use that register for any other purpose, then it suffices to specify the compiler option `-ffixed-REG'. You need not actually add a global register declaration to their source code. A function which can alter the value of a global register variable cannot safely be called from a function compiled without this variable, because it could clobber the value the caller expects to find there on return. Therefore, the function which is the entry point into the part of the program that uses the global register variable must explicitly save and restore the value which belongs to its caller. On most machines, `longjmp' will restore to each global register variable the value it had at the time of the `setjmp'. On some machines, however, `longjmp' will not change the value of global register variables. To be portable, the function that called `setjmp' should make other arrangements to save the values of the global register variables, and to restore them in a `longjmp'. This way, the same thing will happen regardless of what `longjmp' does. All global register variable declarations must precede all function definitions. If such a declaration could appear after function definitions, the declaration would be too late to prevent the register from being used for other purposes in the preceding functions. Global register variables may not have initial values, because an executable file has no means to supply initial contents for a register. On the Sparc, there are reports that g3 ... g7 are suitable registers, but certain library functions, such as `getwd', as well as the subroutines for division and remainder, modify g3 and g4. g1 and g2 are local temporaries. On the 68000, a2 ... a5 should be suitable, as should d2 ... d7. Of course, it will not do to use more than a few of those. File: gcc.info, Node: Local Reg Vars, Prev: Global Reg Vars, Up: Explicit Reg Vars Specifying Registers for Local Variables ---------------------------------------- You can define a local register variable with a specified register like this: register int *foo asm ("a5"); Here `a5' is the name of the register which should be used. Note that this is the same syntax used for defining global register variables, but for a local variable it would appear within a function. Naturally the register name is cpu-dependent, but this is not a problem, since specific registers are most often useful with explicit assembler instructions (*note Extended Asm::.). Both of these things generally require that you conditionalize your program according to cpu type. In addition, operating systems on one type of cpu may differ in how they name the registers; then you would need additional conditionals. For example, some 68000 operating systems call this register `%a5'. Eventually there may be a way of asking the compiler to choose a register automatically, but first we need to figure out how it should choose and how to enable you to guide the choice. No solution is evident. Defining such a register variable does not reserve the register; it remains available for other uses in places where flow control determines the variable's value is not live. However, these registers are made unavailable for use in the reload pass. I would not be surprised if excessive use of this feature leaves the compiler too few available registers to compile certain functions. File: gcc.info, Node: Alternate Keywords, Next: Incomplete Enums, Prev: Explicit Reg Vars, Up: C Extensions Alternate Keywords ================== The option `-traditional' disables certain keywords; `-ansi' disables certain others. This causes trouble when you want to use GNU C extensions, or ANSI C features, in a general-purpose header file that should be usable by all programs, including ANSI C programs and traditional ones. The keywords `asm', `typeof' and `inline' cannot be used since they won't work in a program compiled with `-ansi', while the keywords `const', `volatile', `signed', `typeof' and `inline' won't work in a program compiled with `-traditional'. The way to solve these problems is to put `__' at the beginning and end of each problematical keyword. For example, use `__asm__' instead of `asm', `__const__' instead of `const', and `__inline__' instead of `inline'. Other C compilers won't accept these alternative keywords; if you want to compile with another compiler, you can define the alternate keywords as macros to replace them with the customary keywords. It looks like this: #ifndef __GNUC__ #define __asm__ asm #endif `-pedantic' causes warnings for many GNU C extensions. You can prevent such warnings within one expression by writing `__extension__' before the expression. `__extension__' has no effect aside from this. File: gcc.info, Node: Incomplete Enums, Next: Function Names, Prev: Alternate Keywords, Up: C Extensions Incomplete `enum' Types ======================= You can define an `enum' tag without specifying its possible values. This results in an incomplete type, much like what you get if you write `struct foo' without describing the elements. A later declaration which does specify the possible values completes the type. You can't allocate variables or storage using the type while it is incomplete. However, you can work with pointers to that type. This extension may not be very useful, but it makes the handling of `enum' more consistent with the way `struct' and `union' are handled. This extension is not supported by GNU C++. File: gcc.info, Node: Function Names, Prev: Incomplete Enums, Up: C Extensions Function Names as Strings ========================= GNU CC predefines two string variables to be the name of the current function. The variable `__FUNCTION__' is the name of the function as it appears in the source. The variable `__PRETTY_FUNCTION__' is the name of the function pretty printed in a language specific fashion. These names are always the same in a C function, but in a C++ function they may be different. For example, this program: extern "C" { extern int printf (char *, ...); } class a { public: sub (int i) { printf ("__FUNCTION__ = %s\n", __FUNCTION__); printf ("__PRETTY_FUNCTION__ = %s\n", __PRETTY_FUNCTION__); } }; int main (void) { a ax; ax.sub (0); return 0; } gives this output: __FUNCTION__ = sub __PRETTY_FUNCTION__ = int a::sub (int) File: gcc.info, Node: C++ Extensions, Next: Trouble, Prev: C Extensions, Up: Top Extensions to the C++ Language ****************************** The GNU compiler provides these extensions to the C++ language (and you can also use most of the C language extensions in your C++ programs). If you want to write code that checks whether these features are available, you can test for the GNU compiler the same way as for C programs: check for a predefined macro `__GNUC__'. You can also use `__GNUG__' to test specifically for GNU C++ (*note Standard Predefined Macros: (cpp.info)Standard Predefined.). * Menu: * Naming Results:: Giving a name to C++ function return values. * Min and Max:: C++ Minimum and maximum operators. * Destructors and Goto:: Goto is safe to use in C++ even when destructors are needed. * C++ Interface:: You can use a single C++ header file for both declarations and definitions. * Template Instantiation:: Methods for ensuring that exactly one copy of each needed template instantiation is emitted. * C++ Signatures:: You can specify abstract types to get subtype polymorphism independent from inheritance. File: gcc.info, Node: Naming Results, Next: Min and Max, Up: C++ Extensions Named Return Values in C++ ========================== GNU C++ extends the function-definition syntax to allow you to specify a name for the result of a function outside the body of the definition, in C++ programs: TYPE FUNCTIONNAME (ARGS) return RESULTNAME; { ... BODY ... } You can use this feature to avoid an extra constructor call when a function result has a class type. For example, consider a function `m', declared as `X v = m ();', whose result is of class `X': X m () { X b; b.a = 23; return b; } Although `m' appears to have no arguments, in fact it has one implicit argument: the address of the return value. At invocation, the address of enough space to hold `v' is sent in as the implicit argument. Then `b' is constructed and its `a' field is set to the value 23. Finally, a copy constructor (a constructor of the form `X(X&)') is applied to `b', with the (implicit) return value location as the target, so that `v' is now bound to the return value. But this is wasteful. The local `b' is declared just to hold something that will be copied right out. While a compiler that combined an "elision" algorithm with interprocedural data flow analysis could conceivably eliminate all of this, it is much more practical to allow you to assist the compiler in generating efficient code by manipulating the return value explicitly, thus avoiding the local variable and copy constructor altogether. Using the extended GNU C++ function-definition syntax, you can avoid the temporary allocation and copying by naming `r' as your return value at the outset, and assigning to its `a' field directly: X m () return r; { r.a = 23; } The declaration of `r' is a standard, proper declaration, whose effects are executed *before* any of the body of `m'. Functions of this type impose no additional restrictions; in particular, you can execute `return' statements, or return implicitly by reaching the end of the function body ("falling off the edge"). Cases X m () return r (23); { return; } (or even `X m () return r (23); { }') are unambiguous, since the return value `r' has been initialized in either case. The following code may be hard to read, but also works predictably: X m () return r; { X b; return b; } The return value slot denoted by `r' is initialized at the outset, but the statement `return b;' overrides this value. The compiler deals with this by destroying `r' (calling the destructor if there is one, or doing nothing if there is not), and then reinitializing `r' with `b'. This extension is provided primarily to help people who use overloaded operators, where there is a great need to control not just the arguments, but the return values of functions. For classes where the copy constructor incurs a heavy performance penalty (especially in the common case where there is a quick default constructor), this is a major savings. The disadvantage of this extension is that you do not control when the default constructor for the return value is called: it is always called at the beginning. File: gcc.info, Node: Min and Max, Next: Destructors and Goto, Prev: Naming Results, Up: C++ Extensions Minimum and Maximum Operators in C++ ==================================== It is very convenient to have operators which return the "minimum" or the "maximum" of two arguments. In GNU C++ (but not in GNU C), `A ? B' is the "maximum", returning the larger of the numeric values A and B. These operations are not primitive in ordinary C++, since you can use a macro to return the minimum of two things in C++, as in the following example. #define MIN(X,Y) ((X) < (Y) ? : (X) : (Y)) You might then use `int min = MIN (i, j);' to set MIN to the minimum value of variables I and J. However, side effects in `X' or `Y' may cause unintended behavior. For example, `MIN (i++, j++)' will fail, incrementing the smaller counter twice. A GNU C extension allows you to write safe macros that avoid this kind of problem (*note Naming an Expression's Type: Naming Types.). However, writing `MIN' and `MAX' as macros also forces you to use function-call notation notation for a fundamental arithmetic operation. Using GNU C++ extensions, you can write `int min = i ?' are built into the compiler, they properly handle expressions with side-effects; `int min = i++ ; template ostream& operator << (ostream&, const A&); This strategy will work with code written for either model. If you are using code written for the Cfront model, the file containing a class template and the file containing its member templates should be implemented in the same translation unit. A slight variation on this approach is to use the flag -falt-external-templates instead; this flag causes template instances to be emitted in the translation unit that implements the header where they are first instantiated, rather than the one which implements the file where the templates are defined. This header must be the same in all translation units, or things are likely to break. *Note Declarations and Definitions in One Header: C++ Interface, for more discussion of these pragmas. 3. Explicitly instantiate all the template instances you use, and compile with -fno-implicit-templates. This is probably your best bet; it may require more knowledge of exactly which templates you are using, but it's less mysterious than the previous approach, and it doesn't require any `#pragma's or other g++-specific code. You can scatter the instantiations throughout your program, you can create one big file to do all the instantiations, or you can create tiny files like #include "Foo.h" #include "Foo.cc" template class Foo; for each instance you need, and create a template instantiation library from those. I'm partial to the last, but your mileage may vary. If you are using Cfront-model code, you can probably get away with not using -fno-implicit-templates when compiling files that don't `#include' the member template definitions. File: gcc.info, Node: C++ Signatures, Prev: Template Instantiation, Up: C++ Extensions Type Abstraction using Signatures ================================= In GNU C++, you can use the keyword `signature' to define a completely abstract class interface as a datatype. You can connect this abstraction with actual classes using signature pointers. If you want to use signatures, run the GNU compiler with the `-fhandle-signatures' command-line option. (With this option, the compiler reserves a second keyword `sigof' as well, for a future extension.) Roughly, signatures are type abstractions or interfaces of classes. Some other languages have similar facilities. C++ signatures are related to ML's signatures, Haskell's type classes, definition modules in Modula-2, interface modules in Modula-3, abstract types in Emerald, type modules in Trellis/Owl, categories in Scratchpad II, and types in POOL-I. For a more detailed discussion of signatures, see `Signatures: A C++ Extension for Type Abstraction and Subtype Polymorphism' by Gerald Baumgartner and Vincent F. Russo (Tech report CSD-TR-93-059, Dept. of Computer Sciences, Purdue University, December 1994, to appear in *Software Practice & Experience*). You can get the tech report by anonymous FTP from `ftp.cs.purdue.edu' in `pub/reports/TR93-059.PS.Z'. Syntactically, a signature declaration is a collection of member function declarations and nested type declarations. For example, this signature declaration defines a new abstract type `S' with member functions `int foo ()' and `int bar (int)': signature S { int foo (); int bar (int); }; Since signature types do not include implementation definitions, you cannot write an instance of a signature directly. Instead, you can define a pointer to any class that contains the required interfaces as a "signature pointer". Such a class "implements" the signature type. To use a class as an implementation of `S', you must ensure that the class has public member functions `int foo ()' and `int bar (int)'. The class can have other member functions as well, public or not; as long as it offers what's declared in the signature, it is suitable as an implementation of that signature type. For example, suppose that `C' is a class that meets the requirements of signature `S' (`C' "conforms to" `S'). Then C obj; S * p = &obj; defines a signature pointer `p' and initializes it to point to an object of type `C'. The member function call `int i = p->foo ();' executes `obj.foo ()'. Abstract virtual classes provide somewhat similar facilities in standard C++. There are two main advantages to using signatures instead: 1. Subtyping becomes independent from inheritance. A class or signature type `T' is a subtype of a signature type `S' independent of any inheritance hierarchy as long as all the member functions declared in `S' are also found in `T'. So you can define a subtype hierarchy that is completely independent from any inheritance (implementation) hierarchy, instead of being forced to use types that mirror the class inheritance hierarchy. 2. Signatures allow you to work with existing class hierarchies as implementations of a signature type. If those class hierarchies are only available in compiled form, you're out of luck with abstract virtual classes, since an abstract virtual class cannot be retrofitted on top of existing class hierarchies. So you would be required to write interface classes as subtypes of the abstract virtual class. There is one more detail about signatures. A signature declaration can contain member function *definitions* as well as member function declarations. A signature member function with a full definition is called a *default implementation*; classes need not contain that particular interface in order to conform. For example, a class `C' can conform to the signature signature T { int f (int); int f0 () { return f (0); }; }; whether or not `C' implements the member function `int f0 ()'. If you define `C::f0', that definition takes precedence; otherwise, the default implementation `S::f0' applies. File: gcc.info, Node: Trouble, Next: Bugs, Prev: C++ Extensions, Up: Top Known Causes of Trouble with GNU CC *********************************** This section describes known problems that affect users of GNU CC. Most of these are not GNU CC bugs per se--if they were, we would fix them. But the result for a user may be like the result of a bug. Some of these problems are due to bugs in other software, some are missing features that are too much work to add, and some are places where people's opinions differ as to what is best. * Menu: * Actual Bugs:: Bugs we will fix later. * Installation Problems:: Problems that manifest when you install GNU CC. * Cross-Compiler Problems:: Common problems of cross compiling with GNU CC. * Interoperation:: Problems using GNU CC with other compilers, and with certain linkers, assemblers and debuggers. * External Bugs:: Problems compiling certain programs. * Incompatibilities:: GNU CC is incompatible with traditional C. * Fixed Headers:: GNU C uses corrected versions of system header files. This is necessary, but doesn't always work smoothly. * Standard Libraries:: GNU C uses the system C library, which might not be compliant with the ISO/ANSI C standard. * Disappointments:: Regrettable things we can't change, but not quite bugs. * C++ Misunderstandings:: Common misunderstandings with GNU C++. * Protoize Caveats:: Things to watch out for when using `protoize'. * Non-bugs:: Things we think are right, but some others disagree. * Warnings and Errors:: Which problems in your code get warnings, and which get errors. File: gcc.info, Node: Actual Bugs, Next: Installation Problems, Up: Trouble Actual Bugs We Haven't Fixed Yet ================================ * The `fixincludes' script interacts badly with automounters; if the directory of system header files is automounted, it tends to be unmounted while `fixincludes' is running. This would seem to be a bug in the automounter. We don't know any good way to work around it. * The `fixproto' script will sometimes add prototypes for the `sigsetjmp' and `siglongjmp' functions that reference the `jmp_buf' type before that type is defined. To work around this, edit the offending file and place the typedef in front of the prototypes. * There are several obscure case of mis-using struct, union, and enum tags that are not detected as errors by the compiler. * When `-pedantic-errors' is specified, GNU C will incorrectly give an error message when a function name is specified in an expression involving the comma operator. * Loop unrolling doesn't work properly for certain C++ programs. This is a bug in the C++ front end. It sometimes emits incorrect debug info, and the loop unrolling code is unable to recover from this error. File: gcc.info, Node: Installation Problems, Next: Cross-Compiler Problems, Prev: Actual Bugs, Up: Trouble Installation Problems ===================== This is a list of problems (and some apparent problems which don't really mean anything is wrong) that show up during installation of GNU * On certain systems, defining certain environment variables such as `CC' can interfere with the functioning of `make'. * If you encounter seemingly strange errors when trying to build the compiler in a directory other than the source directory, it could be because you have previously configured the compiler in the source directory. Make sure you have done all the necessary preparations. *Note Other Dir::. * If you build GNU CC on a BSD system using a directory stored in a System V file system, problems may occur in running `fixincludes' if the System V file system doesn't support symbolic links. These problems result in a failure to fix the declaration of `size_t' in `sys/types.h'. If you find that `size_t' is a signed type and that type mismatches occur, this could be the cause. The solution is not to use such a directory for building GNU CC. * In previous versions of GNU CC, the `gcc' driver program looked for `as' and `ld' in various places; for example, in files beginning with `/usr/local/lib/gcc-'. GNU CC version 2 looks for them in the directory `/usr/local/lib/gcc-lib/TARGET/VERSION'. Thus, to use a version of `as' or `ld' that is not the system default, for example `gas' or GNU `ld', you must put them in that directory (or make links to them from that directory). * Some commands executed when making the compiler may fail (return a non-zero status) and be ignored by `make'. These failures, which are often due to files that were not found, are expected, and can safely be ignored. * It is normal to have warnings in compiling certain files about unreachable code and about enumeration type clashes. These files' names begin with `insn-'. Also, `real.c' may get some warnings that you can ignore. * Sometimes `make' recompiles parts of the compiler when installing the compiler. In one case, this was traced down to a bug in `make'. Either ignore the problem or switch to GNU Make. * If you have installed a program known as purify, you may find that it causes errors while linking `enquire', which is part of building GNU CC. The fix is to get rid of the file `real-ld' which purify installs--so that GNU CC won't try to use it. * On Linux SLS 1.01, there is a problem with `libc.a': it does not contain the obstack functions. However, GNU CC assumes that the obstack functions are in `libc.a' when it is the GNU C library. To work around this problem, change the `__GNU_LIBRARY__' conditional around line 31 to `#if 1'. * On some 386 systems, building the compiler never finishes because `enquire' hangs due to a hardware problem in the motherboard--it reports floating point exceptions to the kernel incorrectly. You can install GNU CC except for `float.h' by patching out the command to run `enquire'. You may also be able to fix the problem for real by getting a replacement motherboard. This problem was observed in Revision E of the Micronics motherboard, and is fixed in Revision F. It has also been observed in the MYLEX MXA-33 motherboard. If you encounter this problem, you may also want to consider removing the FPU from the socket during the compilation. Alternatively, if you are running SCO Unix, you can reboot and force the FPU to be ignored. To do this, type `hd(40)unix auto ignorefpu'. * On some 386 systems, GNU CC crashes trying to compile `enquire.c'. This happens on machines that don't have a 387 FPU chip. On 386 machines, the system kernel is supposed to emulate the 387 when you don't have one. The crash is due to a bug in the emulator. One of these systems is the Unix from Interactive Systems: 386/ix. On this system, an alternate emulator is provided, and it does work. To use it, execute this command as super-user: ln /etc/emulator.rel1 /etc/emulator and then reboot the system. (The default emulator file remains present under the name `emulator.dflt'.) Try using `/etc/emulator.att', if you have such a problem on the SCO system. Another system which has this problem is Esix. We don't know whether it has an alternate emulator that works. On NetBSD 0.8, a similar problem manifests itself as these error messages: enquire.c: In function `fprop': enquire.c:2328: floating overflow * On SCO systems, when compiling GNU CC with the system's compiler, do not use `-O'. Some versions of the system's compiler miscompile GNU CC with `-O'. * Sometimes on a Sun 4 you may observe a crash in the program `genflags' or `genoutput' while building GNU CC. This is said to be due to a bug in `sh'. You can probably get around it by running `genflags' or `genoutput' manually and then retrying the `make'. * On Solaris 2, executables of GNU CC version 2.0.2 are commonly available, but they have a bug that shows up when compiling current versions of GNU CC: undefined symbol errors occur during assembly if you use `-g'. The solution is to compile the current version of GNU CC without `-g'. That makes a working compiler which you can use to recompile with `-g'. * Solaris 2 comes with a number of optional OS packages. Some of these packages are needed to use GNU CC fully. If you did not install all optional packages when installing Solaris, you will need to verify that the packages that GNU CC needs are installed. To check whether an optional package is installed, use the `pkginfo' command. To add an optional package, use the `pkgadd' command. For further details, see the Solaris documentation. For Solaris 2.0 and 2.1, GNU CC needs six packages: `SUNWarc', `SUNWbtool', `SUNWesu', `SUNWhea', `SUNWlibm', and `SUNWtoo'. For Solaris 2.2, GNU CC needs an additional seventh package: `SUNWsprot'. * On Solaris 2, trying to use the linker and other tools in `/usr/ucb' to install GNU CC has been observed to cause trouble. For example, the linker may hang indefinitely. The fix is to remove `/usr/ucb' from your `PATH'. * If you use the 1.31 version of the MIPS assembler (such as was shipped with Ultrix 3.1), you will need to use the -fno-delayed-branch switch when optimizing floating point code. Otherwise, the assembler will complain when the GCC compiler fills a branch delay slot with a floating point instruction, such as `add.d'. * If on a MIPS system you get an error message saying "does not have gp sections for all it's [sic] sectons [sic]", don't worry about it. This happens whenever you use GAS with the MIPS linker, but there is not really anything wrong, and it is okay to use the output file. You can stop such warnings by installing the GNU linker. It would be nice to extend GAS to produce the gp tables, but they are optional, and there should not be a warning about their absence. * In Ultrix 4.0 on the MIPS machine, `stdio.h' does not work with GNU CC at all unless it has been fixed with `fixincludes'. This causes problems in building GNU CC. Once GNU CC is installed, the problems go away. To work around this problem, when making the stage 1 compiler, specify this option to Make: GCC_FOR_TARGET="./xgcc -B./ -I./include" When making stage 2 and stage 3, specify this option: CFLAGS="-g -I./include" * Users have reported some problems with version 2.0 of the MIPS compiler tools that were shipped with Ultrix 4.1. Version 2.10 which came with Ultrix 4.2 seems to work fine. Users have also reported some problems with version 2.20 of the MIPS compiler tools that were shipped with RISC/os 4.x. The earlier version 2.11 seems to work fine. * Some versions of the MIPS linker will issue an assertion failure when linking code that uses `alloca' against shared libraries on RISC-OS 5.0, and DEC's OSF/1 systems. This is a bug in the linker, that is supposed to be fixed in future revisions. To protect against this, GNU CC passes `-non_shared' to the linker unless you pass an explicit `-shared' or `-call_shared' switch. * On System V release 3, you may get this error message while linking: ld fatal: failed to write symbol name SOMETHING in strings table for file WHATEVER This probably indicates that the disk is full or your ULIMIT won't allow the file to be as large as it needs to be. This problem can also result because the kernel parameter `MAXUMEM' is too small. If so, you must regenerate the kernel and make the value much larger. The default value is reported to be 1024; a value of 32768 is said to work. Smaller values may also work. * On System V, if you get an error like this, /usr/local/lib/bison.simple: In function `yyparse': /usr/local/lib/bison.simple:625: virtual memory exhausted that too indicates a problem with disk space, ULIMIT, or `MAXUMEM'. * Current GNU CC versions probably do not work on version 2 of the NeXT operating system. * On NeXTStep 3.0, the Objective C compiler does not work, due, apparently, to a kernel bug that it happens to trigger. This problem does not happen on 3.1. * On the Tower models 4N0 and 6N0, by default a process is not allowed to have more than one megabyte of memory. GNU CC cannot compile itself (or many other programs) with `-O' in that much memory. To solve this problem, reconfigure the kernel adding the following line to the configuration file: MAXUMEM = 4096 * On HP 9000 series 300 or 400 running HP-UX release 8.0, there is a bug in the assembler that must be fixed before GNU CC can be built. This bug manifests itself during the first stage of compilation, while building `libgcc2.a': _floatdisf cc1: warning: `-g' option not supported on this version of GCC cc1: warning: `-g1' option not supported on this version of GCC ./xgcc: Internal compiler error: program as got fatal signal 11 A patched version of the assembler is available by anonymous ftp from `altdorf.ai.mit.edu' as the file `archive/cph/hpux-8.0-assembler'. If you have HP software support, the patch can also be obtained directly from HP, as described in the following note: This is the patched assembler, to patch SR#1653-010439, where the assembler aborts on floating point constants. The bug is not really in the assembler, but in the shared library version of the function "cvtnum(3c)". The bug on "cvtnum(3c)" is SR#4701-078451. Anyway, the attached assembler uses the archive library version of "cvtnum(3c)" and thus does not exhibit the bug. This patch is also known as PHCO_4484. * On HP-UX version 8.05, but not on 8.07 or more recent versions, the `fixproto' shell script triggers a bug in the system shell. If you encounter this problem, upgrade your operating system or use BASH (the GNU shell) to run `fixproto'. * Some versions of the Pyramid C compiler are reported to be unable to compile GNU CC. You must use an older version of GNU CC for bootstrapping. One indication of this problem is if you get a crash when GNU CC compiles the function `muldi3' in file `libgcc2.c'. You may be able to succeed by getting GNU CC version 1, installing it, and using it to compile GNU CC version 2. The bug in the Pyramid C compiler does not seem to affect GNU CC version 1. * There may be similar problems on System V Release 3.1 on 386 systems. * On the Intel Paragon (an i860 machine), if you are using operating system version 1.0, you will get warnings or errors about redefinition of `va_arg' when you build GNU CC. If this happens, then you need to link most programs with the library `iclib.a'. You must also modify `stdio.h' as follows: before the lines #if defined(__i860__) && !defined(_VA_LIST) #include insert the line #if __PGC__ and after the lines extern int vprintf(const char *, va_list ); extern int vsprintf(char *, const char *, va_list ); #endif insert the line #endif /* __PGC__ */ These problems don't exist in operating system version 1.1. * On the Altos 3068, programs compiled with GNU CC won't work unless you fix a kernel bug. This happens using system versions V.2.2 1.0gT1 and V.2.2 1.0e and perhaps later versions as well. See the file `README.ALTOS'. * You will get several sorts of compilation and linking errors on the we32k if you don't follow the special instructions. *Note Configurations::. * A bug in the HP-UX 8.05 (and earlier) shell will cause the fixproto program to report an error of the form: ./fixproto: sh internal 1K buffer overflow To fix this, change the first line of the fixproto script to look like: #!/bin/ksh